CUBE CONNECT Edition Help

FAQ - Generation

Why do I get an incorrect result when using PTOT and ATOT in the Adjust Phase of GENERATION to balance P and A?

PTOT and ATOT calculate marginal totals dynamically. In the Adjust Phase, each computation of P and A implies a loop over all zones. If a balance equation is specified as the following

A[2]=PTOT(2)/ATOT(2)*A[2]

Then ATOT(2) will be recalculated for each zone. A[2][1] will be adjusted correctly. But for zone 2 and on, ATOT(2) is no longer the sum of original A[2][i]. Therefore the ratio of PTOT(2)/ATOT(2) is not a constant. The correct way to specify a balance equation with PTOT and ATOT is:

TEMPFAC=PTOT(2)/ATOT(2)
A[2]=TEMPFAC*A[2]

For more on ATOT and PTOT, see COMP.

Why do I get “Duplicate Phase=Iloop” error in Generation?

“Phase=Iloop” is optional in Generation. Voyager will add a “Phase=Iloop” statement to indicate the start of the Iloop phase when it detects a valid Iloop statement the first time. If you coded an Iloop statement before the “Phase=Iloop” line, the program returns the “Duplicate Phase=Iloop” error.

It is recommended that “Phase=Iloop” not be used; instead, let the program determine where the Iloop phase should start.